<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Leave extends BaseModel
{
    use HasFactory;
    protected $table = 'leave';
    // 允许批量操作的字段
    protected $fillable = ['leave_user_id','info','start_time','end_time','type','operator','is_del','created_at','updated_at'];

    public function scopeSearch($query,$params)
    {
        if(!empty($params['leave_user_id'])){
            $query->where('leave_user_id',$params['leave_user_id']);
        }
        return $query;
    }
}
